from fastapi import APIRouter, Body
from myscheduler.scheduler import scheduler

scheduler_router = APIRouter()


@scheduler_router.get("/", response_description="Toggle the scheduler")
async def toggle_scheduler(flag: str):
    if flag == 'start':
        pass
    elif flag == 'resume':
        scheduler.resume()
    elif flag == 'pause':
        scheduler.pause()
    return {
        "status_code": 200,
        "response_type": "success",
        "description": "Students data retrieved successfully",
        "data": "ok"
    }
